package com.bwstudio.common.jwt.response;

import com.bwstudio.common.response.IResponseCode;

/**
 * @author buwei
 */
public enum JwtResponseCodeEnum implements IResponseCode{

	/**
	 * 所有调用第三方API出错默认的返回状态码
	 * 根据阿里java开发手册泰山版的错误码原则
	 * 属于错误来源于用户请求携带的jwt token有误，发现手册中A00~A10已被使用，前缀用A20开始
	 */
	UNKNOWN_ERROR("A2000", "未知错误"),
	TOKEN_INVALID("A2001", "无效的Token"),
	TOKEN_SIGNATURE_INVALID("A2002", "无效的签名"),
	TOKEN_EXPIRED("A2003", "token已过期"),
	TOKEN_MISSION("A2004", "token缺失"),
	REFRESH_TOKEN_INVALID("A2005", "刷新Token无效");

	private String code;

	private String message;

	JwtResponseCodeEnum(String code, String message) {
		this.code = code;
		this.message = message;
	}

	@Override
	public String getCode() {
		return code;
	}

	@Override
	public String getMessage() {
		return message;
	}
}
